package interview.shence;

import java.util.*;

/**
 * Question1
 *
 * @author <a href="zhaoyingling12@163.com">Zhao Simon</a>
 * @description:
 * @date 2021/4/29
 **/
public class Question2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int len = in.nextInt();
        int[] nums = new int[len];

        for (int i = 0; i < len; ++i) {
            nums[i] = in.nextInt();
        }
        int startIndex = in.nextInt();
        int outputNum = in.nextInt();
        List<Integer> output = new ArrayList<>();
        int index = startIndex;
        int direction = 0;
        while (outputNum != 0) {
            output.add(nums[index]); // index >= 0
            outputNum--;
            if (index < len - 1 && direction == 0) {
                index++;
            } else if (index == (len - 1)) {
                direction = -1;
                index--;
            }  else if (index != 0 && direction == -1) {
                index--;
            } else if (index == 0 && direction == -1) {
                index++;
                direction = 0;
            }
        }
        for (int num : output) {
            System.out.println(num);
        }
    }
}
